<template>
	<view class="container">
		<!-- <view class="list-cell">
			<text class="cell-tit">{{$t('set.text1')}}</text>
			<text class="cell-tip">当前版本{{version}}</text>
		</view> -->
		<view class="list-cell b-b" @click="navTo('/pages/client/wallet/definite-withdrawal')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit alpsoftjurnal">{{$t('set.text2')}}</text>
			<image mode="aspectFit" style="width: 30upx; height: 30upx;" :src="staticUrl + 'fh2.png'">
		</view> 
		<view class="list-cell b-b" @click="navTo('/pages/set/language')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit alpsoftjurnal">{{$t('set.text3')}}</text>
			<image mode="aspectFit" style="width: 30upx; height: 30upx;" :src="staticUrl + 'fh2.png'">
		</view> 
		<view class="list-cell b-b" @click="navTo('/pages/set/gywm/gywm')" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit alpsoftjurnal">{{$t('set.text4')}}</text>
			<image mode="aspectFit" style="width: 30upx; height: 30upx;" :src="staticUrl + 'fh2.png'">
		</view> 
		<view class="list-cell m-t b-b" @click="clearFn" hover-class="cell-hover" :hover-stay-time="50">
			<text class="cell-tit alpsoftjurnal">{{$t('set.text5')}}</text>
			<text class="cell-more yticon icon-you"></text>
		</view>
		<view class="list-cell log-out-btn" @click="toLogout">
			<text class="cell-tit alpsoftjurnal">{{$t('set.text6')}}</text>
		</view>
	</view>
</template>

<script>
	import {  
	    mapMutations  
	} from 'vuex';
import util from '../../utils/util';
	export default {
		data() {
			return {
			version:'',
			staticUrl:this.$config.staticUrl,
			}
		},
		onLoad() {
			// #ifdef APP-PLUS
			this.version=plus.runtime.version
			// #endif
		},
		onShow() {
			util.setNavTitle()
		},
		methods:{
			clearFn() {
				uni.clearStorage()
			},
			...mapMutations(['logout']),

			navTo(url){
				uni.navigateTo({
					url:url
				})
			},
			//退出登录
			toLogout(){
				uni.removeStorageSync('userinfo');
				setTimeout(()=>{
					uni.navigateBack();
				}, 200)
				// uni.showModal({
				//     content: this.$t('set.text7'),
				//     success: (e)=>{
				//     	if(e.confirm){
				//     		uni.removeStorageSync('userinfo');
				//     		setTimeout(()=>{
				//     			uni.navigateBack();
				//     		}, 200)
				//     	}
				//     }
				// });
			},
			//switch
			switchChange(e){
				let statusTip = e.detail.value ? '打开': '关闭';
				this.$api.msg(`${statusTip}消息推送`);
			},

		}
	}
</script>

<style lang='scss'>
	page{
		background: $page-color-base;
	}
	.list-cell{
		display:flex;
		align-items:baseline;
		padding: 20upx $page-row-spacing;
		line-height:60upx;
		position:relative;
		background: #fff;
		justify-content: center;
		&.log-out-btn{
			margin-top: 40upx;
			.cell-tit{
				color: $uni-color-primary;
				text-align: center;
				margin-right: 0;
			}
		}
		&.cell-hover{
			background:#fafafa;
		}
		&.b-b:after{
			left: 30upx;
		}
		&.m-t{
			margin-top: 16upx; 
		}
		.cell-more{
			align-self: baseline;
			font-size:$font-lg;
			color:$font-color-light;
			margin-left:10upx;
		}
		.cell-tit{
			flex: 1;
			font-size: $font-base + 2upx;
			color: $font-color-dark;
			margin-right:10upx;
		}
		.cell-tip{
			font-size: $font-base;
			color: $font-color-light;
		}
		switch{
			transform: translateX(16upx) scale(.84);
		}
	}
</style>
